package com.tarena.lbs.business.manager.impl;

import com.tarena.lbs.business.manager.BasicOutputSourceManager;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;

import java.util.function.Supplier;
@Component
public class BasicOutputSourceManagerImpl implements BasicOutputSourceManager {

    @Override
    public Supplier<Message<String>> storeLocationOutput() {
        return () -> {
            // 业务逻辑：生成消息内容
            String payload = "用户位置信息";
            return MessageBuilder
                    .withPayload(payload)
                    .setHeader("timestamp", System.currentTimeMillis())
                    .build();
        };
    }
}
